package com.client;

import java.io.IOException;
import java.net.Socket;
import java.util.Date;
import java.util.Scanner;

/**
 * @author zte
 * @description：客户端1
 * @version:
 * @since 2021/3/9 15:03
 */
public class ClientOne {

    public static void main(String[] args) {
        new Thread( () -> {
            try {
                Socket socket = new Socket("127.0.0.1", 8888);
                Scanner scan = new Scanner(System.in);
                while(scan.hasNextLine()) {
                    String content = scan.nextLine();
                    socket.getOutputStream().write((new Date() + "——client one :" + content).getBytes());
                }
            } catch (IOException e) {
                e.printStackTrace();
            }

        }).start();
    }

}
